package com.py.credit.service;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.Database;
import com.py.credit.entity.IndexCatModel;
import com.py.credit.entity.Model;
import com.py.framework.core.common.Page;

public interface ModelBaseService {

	List<Model> getListForPage(String sortType, Page page);

	public List<Map<String, Object>> getByConditionForPage(List<String> showColumns, String[] additionalColumns,
			String condition, Page page, String kId, String areaId, String industryId);

	public String saveOrUpdate(String id, String bm, String name, String des, String scoreType, double rate,
			String zone, String industry, String reportType, String mainType, String relatedModel, String cjr);

	void updateProcess(@Param(value = "id") String id, @Param(value = "templateType") String templateType,
			@Param(value = "checkType") String checkType, @Param(value = "checkProcess") String checkProcess);

	/**
	 * @param type
	 * @return
	 */
	Integer getQueryCountByType(int type);

	List getRankList(String id);

	void modelIndexCatTreeSave(List<Map> listTree, String modelId, String userId);

	public List<Map> getAllCatAndIndexes(String mainType);

	public List<Map> getdefaultTree(String modelId);

	public List<Map> selectModelForSelect(@Param(value = "mainType") String mainType);

	public List<Map> getRelatedCategoryAndIndexes(@Param(value = "catId") String catId);

	public List<Map> getRelatedCategoryAndIndexesTreeByModelId(@Param(value = "modelId") String modelId);

	public List<Map> getRelatedCategoryAndIndexesByModelId(@Param(value = "modelId") String modelId);

	public void updateWeight(@Param(value = "tree") List<IndexCatModel> tree, @Param(value = "modelId") String modelId);

	public List<Map> getRuleListByIndexModelCat(@Param(value = "indexCatModelId") String indexCatModelId);

	public List<Map> getRuleListByIndexModelCatForZz(@Param(value = "indexCatModelId") String indexCatModelId,@Param(value = "zzType") String zzType);
	
	public void del(@Param(value = "ids") String ids);

	public void setStatus(@Param(value = "status") String status, @Param(value = "id") String id);

	public void updateStandard(@Param(value = "indexCatModelId") String indexCatModelId,
			@Param(value = "standard") String standard);

	public void saveRules(@Param(value = "list") List<Map> list,
			@Param(value = "indexCatModelId") String indexCatModelId);

	public void saveRanks(@Param(value = "list") List<Map> list, @Param(value = "id") String id,
			@Param(value = "cjr") String cjr);

	public void saveCheckProcessForOrg(@Param(value = "orgId") String orgId, @Param(value = "id") String id,
			@Param(value = "checkType") String checkType, @Param(value = "checkProcess") String checkProcess,
			@Param(value = "templateType") String templateType);

	public Map selectOne(@Param(value = "id") String id);

	public Map<String, String> selectCheckProcessForOrg(@Param(value = "orgId") String orgId,
			@Param(value = "id") String id);

	public int validateBm(@Param(value = "id") String id, @Param(value = "bm") String bm);

	public int validateModel(@Param(value = "id") String id, @Param(value = "zone") String zone,
			@Param(value = "industry") String industry, @Param(value = "reportType") String reportType,
			@Param(value = "mainType") String mainType);

	public List<Map> getRuleListByDict(@Param(value = "dictSource") String dictSource);

	public int validateSetStatus(@Param(value = "id") String id);

	List<Map<String, Object>> getModelListForPage(String name, Page page, String orgId);

	List<Map<String, Object>> getModelList(String name);

	List<Map<String, Object>> getModelListByConditionForPage(String orgId, List<String> showColumns,
			String[] additionalColumns, Page page, String condition, String kId, String areaId, String industryId);

	List<Database> getDbList(String kId);
	
    public int getProcessCount(@Param(value = "id") String id);
	
	public int getOrgModelCount(@Param(value = "id") String id);
	
	public List<Map> selectTemplateMap();
	
	public String selectMXSQ(@Param(value = "id") String id);
}
